<template>
	<view v-if="ongoingProductList && ongoingProductList.enrolledActivityProductVoList">
		<view class="product-card" v-for="(item, index) in ongoingProductList.enrolledActivityProductVoList"
			:key="index">
			<view style="display: flex;justify-content: space-between;padding: 20rpx 0;border-bottom: 1rpx solid #eee;">
				<view></view>
				<view>
					{{item.activityTimeList[0].slice(0,10)}}-{{item.activityTimeList[1].slice(0,10)}}
				</view>
			</view>
			<view style="display: flex;">
				<u--image :showLoading="true" :src="item.image" width="80px" height="80px"></u--image>
				<view class="card_right">
					<view @click="toDetails(item)"
						style="display: flex;justify-content: space-between;align-items: center;">
						<view class="u-line-1" style="font-weight: bold;font-size: 32rpx;">
							<span v-if="item.brandName">[{{item.brandName}}]</span>{{item.name}}<text
								style="margin: 0 10rpx;">{{item.sku}}</text>
						</view>

						<uni-icons type="forward" size="15" color="#000"></uni-icons>
					</view>

					<view style="display: flex;font-size: 28rpx;color: #999;margin:20rpx 0 10rpx 0;">
						{{item.operateCityName}}
					</view>

					<view
						style="display: flex;font-size: 26rpx;color: #999;margin: 0 0 12rpx 0;justify-content: space-between;align-items: center;">
						<view><text style="color: #000;font-weight: bold;">￥{{item.activityPrice}}</text><text
								style="margin-left: 10rpx;text-decoration: line-through;">￥{{item.price}}</text></view>
					</view>
				</view>
			</view>
			<view style="border: 1rpx solid #f2f2f2;margin: 8rpx 0;"></view>
			<view style="display: flex;justify-content: space-between;margin: 20rpx 0;">
				<view class="sales-volume">
					<text style="color:#999">今日商品销售量</text>
					<span style="margin-left: 10rpx;">{{item.salesVolume}}</span>
				</view>
				<view class="sales-volume">
					<text style="color:#999">剩余库存</text>
					<span style="margin-left: 10rpx;">{{item.inventory}}</span>
				</view>
			</view>

		</view>
		<!-- <view class='noCommodity' >
			<view class='pictrue'>
				<image src='../../static/noCollect.png'></image>
			</view>
			<text class="text-ccc" style="font-weight: bolder;">暂无信息</text>
		</view> -->
	</view>
</template>

<script>
	import {
		setThemeColor
	} from '../../../../utils/setTheme';
	let app = getApp();
	export default {
		props: {

			parentId: {
				type: String,
				default: ''
			},
			bgColor: {
				type: String,
				default: 'blue'
			},
			currentInd: {
				type: Number,
				default: 0,
			},
			ongoingProductList: {
				type: Object,
				default: () => {
					return {}
				}
			},
			activityCategory: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {
				theme: app.globalData.theme,
				scrollable: true,
				dataList: [{
					image: 'http://192.168.1.29:8080/img_xyt/public/product/2024/04/23/3669c2389d38458582e36ee84d6fe235o80gc46lgn.png',
					name: '红壳鲜鸡蛋',
					skuName: '中码 30斤',
					hotNum: 2,
				}, {
					brandName: '金龙鱼',
					image: 'http://192.168.1.29:8080/img_xyt/public/product/2024/04/23/3669c2389d38458582e36ee84d6fe235o80gc46lgn.png',
					name: '雪花小麦小麦粉八星',
					skuName: '25kg',
					hotNum: 3,
				}, {
					brandName: '金龙鱼',
					image: 'http://192.168.1.29:8080/img_xyt/public/product/2024/04/23/3669c2389d38458582e36ee84d6fe235o80gc46lgn.png',
					name: '雪花小麦小麦粉八星',
					skuName: '25kg',
					hotNum: 3,
				}, {
					brandName: '金龙鱼',
					image: 'http://192.168.1.29:8080/img_xyt/public/product/2024/04/23/3669c2389d38458582e36ee84d6fe235o80gc46lgn.png',
					name: '雪花小麦小麦粉八星',
					skuName: '25kg',
					hotNum: 3,
				}],
				refreshing: false,
				refreshText: "",
				refreshFlag: false,
				// ----------------------
				productLoading: false,
				productParam: {
					current: 1,
					size: 10,
					// cateId: "",
					// keywords: "",
					// type: 1,
				},
				totalPage: 1, //总页面数量
				loadMoreStatus: 'more', // 底部状态 noMore loading
			}
		},
		onLoad() {
			this.bgColor = setThemeColor()
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.bgColor,
			});
		},
		created() {},
		methods: {
			toDetails(item) {
				this.$emit('toDetails', item);
			},
			

		}
	}
</script>

<style scoped lang="scss">
	.bg_color {
		@include main_bg_color(theme);
	}

	.plain_bgColor {
		@include main_color(theme);
		// @include main_bg_rgba_color(theme, 0.05);
		border: 1rpx solid;
	}

	.list {
		background-color: $main-background-color;
	}

	.card_right {
		display: flex;
		flex-flow: column;
		flex: 1;
		margin: 6px 6px 0 6px;

		.u-line {
			display: -webkit-box !important;
			/* overflow: hidden; */
			text-overflow: ellipsis;
			word-break: break-all;
			-webkit-line-clamp: 1;
			-webkit-box-orient: vertical !important;
			font-size: 32rpx;
			font-weight: bold;
		}

		// 客户热度
		.class-hot {
			font-size: 24rpx;
			margin: 13rpx 0;
			color: #999;
			display: flex;
			align-items: center;
		}
	}


	.product-card {
		background-color: #fff;
		border-radius: 18rpx;
		margin: 20rpx 0;
		padding: 20rpx;
	}

	.noCommodity {
		margin-top: 30%;
		align-items: center;
		text-align: center;
		justify-content: center;
	}
</style>